
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>接口文档</title>
  <link rel="stylesheet" href="/Public/assets/layui2.8.6/css/layui.css">
  <link rel="stylesheet" href="/Public/common/css/md.css">
  <link rel="stylesheet" href="/Public/common/css/xiyucode.css?v=2.1">
  <style>
   body{
    padding:20px;
   }
  </style>
</head>
<body>

<div class="layui-container">
<form class="layui-form hhq-form" action="">
  <div class="layui-form-item">
    <label class="layui-form-label">选择文档：</label>
    <div class="layui-input-inline">
      <select name="docs" id="docs" lay-ignore>
        <option value="jifen">积分接口</option>
      </select>
    </div>
  </div>
</form>
  <div id="app" class="md-content"></div>
</div>
<script src="/Public/jquery.min.js"></script>
<script src="/Public/assets/layui2.8.6/layui.js"></script>
<script src="/Public/marked.min.js"></script>
<script>
  layui.use(['layer', 'form'], function(){
    
    function loadDocs(docs){
      $.ajax({
        url: '/apidocs/md/' + docs+'.md',
        type: 'GET',
        dataType: 'text',
        success: function(data){
          var html = marked.parse(data);
          $('#app').html(html);
        }
      });
    }
    loadDocs($('#docs').val());
    $('#docs').on('change', function(){
      loadDocs($(this).val());
    });
  });

</script> 
</body>
</html>
